package com.yangfan.cloudalibaba.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @description: OpenFeign 只需要写一个借口 还有注解皆可以访问了
 * @author: yangfan
 * @date: Created in 2020/4/20 0020 15:19
 * @modified By:
 */

@Component
@FeignClient(value = "nacoss-payment-provider",fallback = PaymentServiceFallback.class)
public interface PaymentService {

    @GetMapping(value = "/provider/nacos/{id}")
    String getPayment(@PathVariable(value = "id") Long id);


    @GetMapping(value = "/provider/nacos/getInfo")
    String getInfo();


    @GetMapping(value = "/provider/sentinel/hello/{name}")
    String apiHello(@PathVariable(value = "name") String name);


    @GetMapping(value = "/provider/sentinel/hotKey")
    String testHotKey(@RequestParam(value = "p1",required = false) String p1 , @RequestParam(value = "p2",required = false) String p2);




}
